import {
  ButtonSizeType,
  ButtonType,
  CheckLayoutType,
  DateType, ProgressStatus,
  SelectType,
  SwitchColor,
  TagType, TopActionType,
  UploadType, WindowType
} from '../../shared/components/dhlcomponent/enums';
import {appInjector} from '../../shared/utils/app-injector';
import {MessageService} from '../../services/system/message.service';
import {WindowService} from '../../services/system/window.service';
import {RequestService} from '../../services/system/request.service';
import {CacheDataService} from '../../services/system/cache.data.service';
import {PermissionService} from '../../services/system/permission.service';
import {ActivatedRoute, Router} from '@angular/router';
import {Directive, Input} from '@angular/core';
import {environment} from '../../../environments/environment';


@Directive()
export class CommonPage {


  @Input() menu;
  appCode = environment.appCode;

  // 按钮大小
  btnSizeSmall = ButtonSizeType.SMALL;
  btnSizeDefault = ButtonSizeType.DEFAULT;
  btnSizeLarge = ButtonSizeType.LARGE;

  // Table 的top 按钮样式
  topBtnDefualt = TopActionType.DEFAULT;
  topBtnCombine = TopActionType.COMBINE;

  // 按钮样式
  btnTypePrimary = ButtonType.PRIMARY;
  btnTypeGray = ButtonType.GRAY;
  btnTypeDanger = ButtonType.DANGER;
  btnTypeDefault = ButtonType.DEFAULT;
  btnTypeLink = ButtonType.LINK;
  btnTypeDashed = ButtonType.DASHED;


  // 日期类型
  dateSingle = DateType.DATE;
  dateRange = DateType.RANGE;
  dateYear = DateType.YEAR;
  dateMonth = DateType.MONTH;
  dateWeek = DateType.WEEK;


  // 树形类型
  selectDefault = SelectType.DEFAULT;
  selectMultiple = SelectType.MULTIPLE;
  selectTree = SelectType.TREE;
  selectTreeMul = SelectType.TREEMUL;

  // 复选框布局，横向还是纵向
  checkLayoutCol = CheckLayoutType.COL;
  checkLayoutRow = CheckLayoutType.ROW;

  // 上传控件类别
  uploadTypeBTN = UploadType.BUTTON;
  uploadTypeCard = UploadType.CARD;

  // Tag颜色
  tagRed = TagType.RED;
  tagGreen = TagType.GREEN;
  tagGrey = TagType.GREY;
  tagYellow = TagType.YELLOW;

  // Switch颜色
  switchRed = SwitchColor.RED;
  switchGreen = SwitchColor.GREEN;
  switchGrey = SwitchColor.GREY;
  switchYellow = SwitchColor.YELLOW;


  // windows 弹出类型
  windowWindow = WindowType.WINDOWS;
  windowDrawer = WindowType.DRAWER;

  progressDefault = ProgressStatus.DEFAULT;
  progressActive = ProgressStatus.ACTIVE;
  progressException = ProgressStatus.EXCEPTION;

  messageService = appInjector().get(MessageService);
  windowService = appInjector().get(WindowService);
  permissionService = appInjector().get(PermissionService);
  requestService = appInjector().get(RequestService);
  cacheService = appInjector().get(CacheDataService);
  activeRouter = appInjector().get(ActivatedRoute);
  router = appInjector().get(Router);
}
